home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / create2a / demo.txt next >
Encoding:
Text File  |  1999-09-28  |  2.2 KB  |  52 lines

  1. *** Creating a demo version of a program with copy protection ***
  2.  
  3.  
  4. Here are some techniques that I use in the project Demo.vbp, this techniques are often used 
  5. in most systems who features Demo versions.
  6.  
  7. The general ideas behind all demo versions of commercial softwares that are sell all around
  8. the world are almost the same:
  9. Save some entries to the windows registry, describing basically the date of installation of the
  10. demo version. This entry is always saved encrypted, or any other way that you cannot alter by
  11. editing the registry.
  12.  
  13. The project here shows security scheme that is based upon three factors:
  14.  
  15. 1 - Serial number of the HD
  16. 2 - Date of installation
  17. 3 - Number of times that the application has run.
  18.  
  19.  
  20. Based on that, you can lock your application if the user has passed X days after the installation
  21. or Y times the system has run.
  22. All the entries are saved encrypted.
  23.  
  24. The serial number of the HD gives you the ability to let the user pass you his code, you apply
  25. it to some mathematical expression and give back the user a registration code.
  26. Every time the application starts, it checks for the HD's serial number and the registration code.
  27. If they don't match (based on the math expression you used), there is some error and the 
  28. application locks (or if you want, convert it back to the demo version).
  29.  
  30. If you want to delete the settings, go to
  31. HKEY_CURRENT_USER\Software\VB and VBA Program Settings\DemoApp\Install
  32. and delete the key.
  33.  
  34. NOTES: 
  35. 1 - You can design your software to be a Demo version by disabling some features, just by
  36. assigning a public variable "Demo" as boolean.
  37. 2 - Here I save the settings using the standard "SaveSetting" and "GetSetting" functions from VB.
  38. However, you can use an API function to place it anywhere else in the registry.
  39. Alternatively to increase the security, you can put each of the settings in different
  40. sections, to prevent the user from deleting the settings (wich would reinitialize the counter of
  41. the demo version).
  42.  
  43. The encryption and decryption functions I picked up from Planet Source Code, but can't remember
  44. from who it is. Sorry, and thanks!  :)
  45.  
  46.  
  47. Hope this helps somebody.
  48.  
  49. Alexandre Moro
  50. alb@cwb.matrix.com.br
  51.  
  52.